<template>
    <div id="wrap">
      <h1>defineEmits带类型声明</h1>
      <scu12 @submit="submitHandler"></scu12>
      <hr>
      <scu13 
      @edit-user="editUserHandler"
      @edit="editrHandler"
      @update="updateHandler"
      @change="changeHandler"
      ></scu13>
    </div>
  </template>
  
  <script lang='ts'>
  export default {
    name: 'scu21',
  }
  </script>
  
  <script lang='ts' setup>
import { type Iuser } from './component/scu13.vue';
import scu12 from "./component/scu12.vue";
import scu13 from "./component/scu13.vue";
const submitHandler=(payload:{email:string;password:string})=>{
    console.log('submitHandler');
    if(payload.email=='222' && payload.password=='333'){
        return alert('账号密码验证成功')
    }else{
        return alert('错误')
    }
}
const editUserHandler=(user:Iuser)=>{
  console.log(user,'editUserHandler');
}
const editrHandler=(val1:string,val2:number)=>{
  console.log(val1,val2);
}
const updateHandler=(val:string)=>{
  console.log(val);
}
const changeHandler=(id:number)=>{
  console.log(id);
}
</script>

<style scoped lang='scss'>

</style>